package com.neu.elm.controller;

import com.neu.elm.po.User;
import com.neu.elm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:csw
 * @Date: 8:46 2020/9/16
 */
@RestController
@RequestMapping("/userController")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("/getUserByIdByPass")
    public User getUserByIdByPass(User user) throws Exception{
        return userService.getUserByIdByPass(user);
    }

    @RequestMapping("/getUserById")
    public int getUserById(String userId) throws Exception{
        return userService.getUserById(userId);
    }

    @RequestMapping("/saveUser")
    public int saveUser(User user) throws Exception{
        return userService.saveUser(user);
    }
}
